# @before-stub-for-debug-begin
from python3problem11 import *
from typing import *
# @before-stub-for-debug-end

#
# @lc app=leetcode.cn id=11 lang=python3
#
# [11] 盛最多水的容器
#

# @lc code=start
class Solution:
    def getv(self, i, j, iv, jv):
        return (j-i)*min(iv,jv)
    
    def maxArea(self, height: List[int]) -> int:
        L = len(height)
        i, j = 0, L-1
        v = self.getv(i, j, height[i], height[j])
        while i < j:
            if height[i] < height[j]:
                i += 1
            else:
                j -= 1
            v = max(v, self.getv(i, j, height[i], height[j]))
        return v

    
# @lc code=end

